import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import http from './http'

Vue.use(ElementUI)
Vue.config.productionTip = false
// 挂载axios
Vue.prototype.$http = http

// 混入代码块 全局使用 在new前使用
Vue.mixin({
  computed: {
    mixin_uploadUrl () {
      return this.$http.defaults.baseURL + '/upload'
    }
  },
  methods: {
    mixin_getAuthHeaders () {
      return {
        Authorization: 'Bearer ' + (localStorage.token || '')
      }
    }
  }
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
